Function.prototype.call = function (thisArg, ...args) {
    fn = Symbol("fn")
    let tmp = thisArg || window
    tmp[fn] = this
    const result = tmp[fn](...args)
    delete tmp[fn]
    return result
}

function aaa(a) {
    console.log(1, a);
}
var obj = {
    name: '123'
}
aaa.call(obj, 3)


Function.prototype.bind = function (thisArg, ...args) {
    var self = this
    var fbound = function () {
        let a = Array.prototype.slice.call(arguments)
        self.apply(this instanceof self ? this : thisArg, args.concat(a))

    }
    fbound.prototype = Object.create(self.prototype)
    return fbound
}
Function.prototype.bind2 = function (thisArg, ...arg) {
    const args = Array.prototype.slice.call(arguments)
    const self = this
    return function () {
        return self.apply(thisArg, args)
    }
}

document.getElementById("ul").onclick = function (event) {
    event.target.innerText;
}